Optimal. Leaf size=66 \[ \frac {7 x}{2 a^2}+\frac {16 \cos (x)}{3 a^2}-\frac {7 \cos (x) \sin (x)}{2 a^2}+\frac {8 \cos (x) \sin ^2(x)}{3 a^2 (1+\sin (x))}+\frac {\cos (x) \sin ^3(x)}{3 (a+a \sin (x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {2844, 3056,
2813} \begin {gather*} \frac {7 x}{2 a^2}+\frac {16 \cos (x)}{3 a^2}+\frac {8 \sin ^2(x) \cos (x)}{3 a^2 (\sin (x)+1)}-\frac {7 \sin (x) \cos (x)}{2 a^2}+\frac {\sin ^3(x) \cos (x)}{3 (a \sin (x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2813
Rule 2844
Rule 3056
Rubi steps
\begin {align*} \int \frac {\sin ^4(x)}{(a+a \sin (x))^2} \, dx &=\frac {\cos (x) \sin ^3(x)}{3 (a+a \sin (x))^2}-\frac {\int \frac {\sin ^2(x) (3 a-5 a \sin (x))}{a+a \sin (x)} \, dx}{3 a^2}\\ &=\frac {8 \cos (x) \sin ^2(x)}{3 a^2 (1+\sin (x))}+\frac {\cos (x) \sin ^3(x)}{3 (a+a \sin (x))^2}-\frac {\int \sin (x) \left (16 a^2-21 a^2 \sin (x)\right ) \, dx}{3 a^4}\\ &=\frac {7 x}{2 a^2}+\frac {16 \cos (x)}{3 a^2}-\frac {7 \cos (x) \sin (x)}{2 a^2}+\frac {8 \cos (x) \sin ^2(x)}{3 a^2 (1+\sin (x))}+\frac {\cos (x) \sin ^3(x)}{3 (a+a \sin (x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 100, normalized size = 1.52 \begin {gather*} \frac {\left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \left (21 (-7+12 x) \cos \left (\frac {x}{2}\right )+(239-84 x) \cos \left (\frac {3 x}{2}\right )+3 \left (-5 \cos \left (\frac {5 x}{2}\right )+\cos \left (\frac {7 x}{2}\right )+2 (-50+56 x+(27+28 x) \cos (x)+6 \cos (2 x)+\cos (3 x)) \sin \left (\frac {x}{2}\right )\right )\right )}{48 a^2 (1+\sin (x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 80, normalized size = 1.21
method | result | size |
default | \(\frac {-\frac {4}{3 \left (\tan \left (\frac {x}{2}\right )+1\right )^{3}}+\frac {2}{\left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {6}{\tan \left (\frac {x}{2}\right )+1}+\frac {2 \left (\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{2}+2 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-\frac {\tan \left (\frac {x}{2}\right )}{2}+2\right )}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+7 \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a^{2}}\) | \(80\) |
risch | \(\frac {7 x}{2 a^{2}}+\frac {i {\mathrm e}^{2 i x}}{8 a^{2}}+\frac {{\mathrm e}^{i x}}{a^{2}}+\frac {{\mathrm e}^{-i x}}{a^{2}}-\frac {i {\mathrm e}^{-2 i x}}{8 a^{2}}+\frac {8 \,{\mathrm e}^{2 i x}-\frac {22}{3}+14 i {\mathrm e}^{i x}}{\left ({\mathrm e}^{i x}+i\right )^{3} a^{2}}\) | \(80\) |
norman | \(\frac {\frac {7 \left (\tan ^{10}\left (\frac {x}{2}\right )\right )}{a}+\frac {25 \tan \left (\frac {x}{2}\right )}{a}+\frac {92 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{a}+\frac {7 x}{2 a}+\frac {32}{3 a}+\frac {21 x \tan \left (\frac {x}{2}\right )}{2 a}+\frac {49 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {91 x \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {63 x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{a}+\frac {77 x \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{a}+\frac {77 x \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{a}+\frac {63 x \left (\tan ^{7}\left (\frac {x}{2}\right )\right )}{a}+\frac {91 x \left (\tan ^{8}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {49 x \left (\tan ^{9}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {21 x \left (\tan ^{10}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {7 x \left (\tan ^{11}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {21 \left (\tan ^{9}\left (\frac {x}{2}\right )\right )}{a}+\frac {108 \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{a}+\frac {84 \left (\tan ^{7}\left (\frac {x}{2}\right )\right )}{a}+\frac {161 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{3 a}+\frac {130 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{a}+\frac {314 \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{3 a}+\frac {140 \left (\tan ^{8}\left (\frac {x}{2}\right )\right )}{3 a}}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{4} a \left (\tan \left (\frac {x}{2}\right )+1\right )^{3}}\) | \(273\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 198 vs.
\(2 (56) = 112\).
time = 0.73, size = 198, normalized size = 3.00 \begin {gather*} \frac {\frac {75 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {97 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {126 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {98 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {63 \, \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} + \frac {21 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} + 32}{3 \, {\left (a^{2} + \frac {3 \, a^{2} \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {5 \, a^{2} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {7 \, a^{2} \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {7 \, a^{2} \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {5 \, a^{2} \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} + \frac {3 \, a^{2} \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} + \frac {a^{2} \sin \left (x\right )^{7}}{{\left (\cos \left (x\right ) + 1\right )}^{7}}\right )}} + \frac {7 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 105, normalized size = 1.59 \begin {gather*} -\frac {3 \, \cos \left (x\right )^{4} - {\left (21 \, x - 31\right )} \cos \left (x\right )^{2} - 6 \, \cos \left (x\right )^{3} + {\left (21 \, x + 38\right )} \cos \left (x\right ) + {\left (3 \, \cos \left (x\right )^{3} + {\left (21 \, x + 40\right )} \cos \left (x\right ) + 9 \, \cos \left (x\right )^{2} + 42 \, x + 2\right )} \sin \left (x\right ) + 42 \, x - 2}{6 \, {\left (a^{2} \cos \left (x\right )^{2} - a^{2} \cos \left (x\right ) - 2 \, a^{2} - {\left (a^{2} \cos \left (x\right ) + 2 \, a^{2}\right )} \sin \left (x\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 1423 vs.
\(2 (70) = 140\).
time = 5.05, size = 1423, normalized size = 21.56 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.58, size = 72, normalized size = 1.09 \begin {gather*} \frac {7 \, x}{2 \, a^{2}} + \frac {\tan \left (\frac {1}{2} \, x\right )^{3} + 4 \, \tan \left (\frac {1}{2} \, x\right )^{2} - \tan \left (\frac {1}{2} \, x\right ) + 4}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}^{2} a^{2}} + \frac {2 \, {\left (9 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 21 \, \tan \left (\frac {1}{2} \, x\right ) + 10\right )}}{3 \, a^{2} {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.81, size = 77, normalized size = 1.17 \begin {gather*} \frac {7\,x}{2\,a^2}+\frac {7\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6+21\,{\mathrm {tan}\left (\frac {x}{2}\right )}^5+\frac {98\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4}{3}+42\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3+\frac {97\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{3}+25\,\mathrm {tan}\left (\frac {x}{2}\right )+\frac {32}{3}}{a^2\,{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )}^2\,{\left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________